package lego.jbv;

import lejos.nxt.Button;
import lejos.nxt.LCD;
import lejos.nxt.SensorPort;
import lejos.robotics.subsumption.Arbitrator;
import lejos.robotics.subsumption.Behavior;
import lejos.util.Delay;


public class Sumo {
	public static void main(String[] args) {
		Car car = new Car();
		
		Behavior wander = new Wander(car);
		Behavior attack = new Attack(SensorPort.S2,car); //TODO: Define correct ports for the touch sensors.
		Behavior stayAlive = new StayAlive(SensorPort.S3,car); //TODO: Define correct ports for the color sensor.
		Behavior stop = new Stop(car);
		
		Behavior[] behaviorList = { wander, attack, stayAlive, stop}; // Prioritied list from low to high.
		Arbitrator arbitrator = new Arbitrator(behaviorList);
		
		LCD.clear();
		LCD.drawString("Ready. Press any button.", 0, 1);
		Button.waitForAnyPress();
		Delay.msDelay(3000);
		arbitrator.start();
	}
}